package com.bc.trade.channel;

import com.bc.common.message.AppidPayReq;
import com.bc.common.message.AppidPayResp;
import com.bc.common.message.AppidWxgjPayReq;
import com.bc.common.message.AppidWxgjPayResp;
import com.bc.common.message.DFReq;
import com.bc.common.message.DFResp;
import com.bc.common.message.TransferQrcodeReq;
import com.bc.common.message.TransferQrcodeResp;
import com.bc.common.message.WxgjClearingReq;
import com.bc.common.message.WxgjClearingResp;
import com.bc.trade.message.BindBankCardReq;
import com.bc.trade.message.BindBankCardResp;
import com.bc.trade.message.BindBankCardVerifyReq;
import com.bc.trade.message.BindBankCardVerifyResp;
import com.bc.trade.message.QueryCardInfoReq;
import com.bc.trade.message.QueryCardInfoResp;
import com.bc.trade.message.QueryOrderResp;
import com.bc.trade.message.QuickPayReq;
import com.bc.trade.message.QuickPayResp;
import com.bc.trade.message.QuickPaySetReq;
import com.bc.trade.message.QuickPaySetResp;
import com.bc.trade.message.RefundReq;
import com.bc.trade.message.RefundResp;
import com.bc.trade.message.SendSMSReq;
import com.bc.trade.message.SendSMSResp;
import com.bc.trade.message.UnionPayReq;
import com.bc.trade.message.UnionPayResp;
import com.bc.trade.model.TradeOrder;
import com.bc.trade.model.TradeStrategy;

/**
 * 渠道接口
 * 
 * @author Reed
 * @date 2017年9月22日
 */
public interface IChannel {

	/**
	 * 查询订单
	 * 
	 * @param req
	 * @return
	 * @throws Exception
	 */
	public QueryOrderResp query(TradeOrder order) throws Exception;

	/**
	 * 代付查询
	 * 
	 * @param order
	 * @return
	 * @throws Exception
	 */
	public QueryOrderResp dfQuery(TradeOrder order) throws Exception;

	/**
	 * 代付
	 * 
	 * @param req
	 * @param order
	 * @return
	 * @throws Exception
	 */
	public DFResp df(DFReq req, TradeOrder order) throws Exception;

	/**
	 * 银联支付
	 * 
	 * @param req
	 * @param order
	 * @return
	 * @throws Exception
	 */
	public UnionPayResp unionpay(UnionPayReq req, TradeOrder order) throws Exception;

	/**
	 * 快捷支付制单
	 * 
	 * @param req
	 * @param order
	 * @return
	 * @throws Exception
	 */
	public QuickPaySetResp quickPaySet(QuickPaySetReq req, TradeOrder order) throws Exception;

	/**
	 * 快捷支付
	 * 
	 * @param req
	 * @param order
	 * @return
	 * @throws Exception
	 */
	public QuickPayResp quickPay(QuickPayReq req, TradeOrder order) throws Exception;

	/**
	 * 发送短信--快捷支付
	 * 
	 * @param req
	 * @param order
	 * @return
	 * @throws Exception
	 */
	default SendSMSResp sendSMS(SendSMSReq req) throws Exception {
		throw new Exception("方法尚未实现");
	}

	/**
	 * 查询历史支付过的银行卡列表--快捷支付
	 * 
	 * @param req
	 * @param order
	 * @return
	 * @throws Exception
	 */
	default QueryCardInfoResp queryCardInfo(QueryCardInfoReq req) throws Exception {
		throw new Exception("方法尚未实现");
	}
	/**
	 * 退款
	 * 
	 * @param req
	 * @param refundOrder
	 * @return
	 * @throws Exception
	 */
	default RefundResp refund(RefundReq req, TradeOrder refundOrder, TradeOrder orignOrder) throws Exception {
		throw new Exception("方法尚未实现");
	}
	
	default RefundResp wxgjRefundQuery(RefundReq req,  TradeOrder orignOrder) throws Exception {
		throw new Exception("方法尚未实现");
	}
	
	default RefundResp wxgjRefund(RefundReq req, TradeOrder refundOrder, TradeOrder orignOrder) throws Exception {
		throw new Exception("方法尚未实现");
	}
	/**
	 * 快捷支付绑卡
	 * 
	 * @param req
	 * @return
	 * @throws Exception
	 */
	default BindBankCardResp bindBankCard(BindBankCardReq req, TradeOrder order) throws Exception {
		throw new Exception("方法尚未实现");
	}

	/**
	 * 快捷支付绑卡确认
	 * 
	 * @param req
	 * @return
	 * @throws Exception
	 */
	default BindBankCardVerifyResp bindBankCardVerify(BindBankCardVerifyReq req, TradeOrder order) throws Exception {
		throw new Exception("方法尚未实现");
	}

	/**
	 * 转账二维码
	 * 
	 * @param req
	 * @param order
	 * @return
	 * @throws Exception
	 */
	default TransferQrcodeResp transferQrcode(TransferQrcodeReq req, TradeOrder order) throws Exception {
		throw new Exception("方法尚未实现");
	}
	
	/**
	 * 支付宝生活号及微信公众号支付
	 * 
	 * @param req
	 * @param order
	 * @return
	 * @throws Exception
	 */
	default AppidPayResp appidPay(AppidPayReq req, TradeOrder order, String hkOrgCode) throws Exception {
		throw new Exception("方法尚未实现");
	}
	
	
	/**
	 * 支付宝生活号及微信公众号支付
	 * 
	 * @param req
	 * @param order
	 * @return
	 * @throws Exception
	 */
	default AppidWxgjPayResp wxgjappidPay(AppidWxgjPayReq req, TradeOrder order) throws Exception {
		throw new Exception("方法尚未实现");
	}
	
	//查询已经结算的金额
	default WxgjClearingResp wxgjGetClearingData(WxgjClearingReq req, TradeStrategy ts) throws Exception{
		throw new Exception("方法尚未实现");
	}
	
	
	/**
	 * 微信刷卡支付
	 * 
	 * @param req
	 * @param order
	 * @return
	 * @throws Exception
	 */
	default AppidWxgjPayResp wxgjmiropay(AppidWxgjPayReq req, TradeOrder order) throws Exception {
		throw new Exception("方法尚未实现");
	}
	
	/**
	 * 微信动态二维码
	 * 
	 * @param req
	 * @param order
	 * @return
	 * @throws Exception
	 */
	default AppidWxgjPayResp wxgjqrcode(AppidWxgjPayReq req, TradeOrder order) throws Exception {
		throw new Exception("方法尚未实现");
	}
	
	default AppidWxgjPayResp wxgjappidPayOrder(TradeOrder order) throws Exception {
		throw new Exception("方法尚未实现");
	}
	
}
